<!DOCTYPE html>
<html>
<head>

</head>
<body>
<script>
function getClickHandler() {
	return function(info, tab) {
		
		var jsonified = escape(info.selectionText);
		
		// The srcUrl property is only available for image elements.
		var url = 'newTask.html?notes=' + jsonified;
		
		// Create a new window to the info page.
		chrome.windows.create({ url: url, width: 620, height: 560, type: "popup" });
	};

};

chrome.contextMenus.create({
	"title" : "Create HM Task",
	"type" : "normal",
	"contexts" : ["selection"],
	"onclick" : getClickHandler()
});
</script>
</body>
</html>